Activities of "jpietkiewicz_"

Is it possible to limit the number of users logged in at the same time, i.e. license management

We are looking at license managers that we can integrate into our application to prohibit customers from running the application without a license, but we also need to be able to deny new user logins when the max number of users has been reached (we would obtain the max # from the license).

Hello Support!

Is there code generation tools for entities? It seems like there is alot of boilerplate when it comes to adding entities.

Our domain has many entities, so we would like to know if there are tools in the abp cli to save us time by generating code.

If there is not, I am thinking of using jinja as I have been successful in the past generating boilerplate with such a tool.

Do you have suggestions or plans on adding more code generation? Is there a tool like jinja but for dotnet which I could explore (and possibly submit to the abp framework)?

Thanks!

I have started to build a abp code generation tool around telsoys cli and velocity engine. We can collaborate on it. I have one template/page ready: Domain entity. It is based on DSL language that telosys offers. You can use vs code telosys extension to write your entities or Eclipse plugin. It allows both generation from a model class or from DB table. You can see videos:
https://www.youtube.com/channel/UCX5-ypQygEHMCGXVTTbhfNQ I basically build a tooling to enable telosys tool to be abp aware. My generation allows code re-generation, so you can preserve your custom code. Let me know if you are interested.

Rad

This sounds amazing. I will look into it more and get back to you.

Same issue as https://support.abp.io/QA/Questions/2824/An-error-occurred-while-generating-the-client-proxy-for-microserviceangular I have multiple microservice backends defined and I need to generate the proxies for the frontend.

  • ABP Framework version: v5.2.1
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): angular

Question 1

Am I supposed to add the service names and urls to environment.ts before I run abp generate-proxy -t ng ? For example if I have two new services named "SecondService" and "ThirdService" do I make environment.ts look like this (look for my comments to indicate what I changed:

import { Environment } from '@abp/ng.core';

const baseUrl = 'http://localhost:4200';

const oAuthConfig = {
  issuer: 'https://localhost:44322',
  redirectUri: baseUrl,
  clientId: 'mvm_Angular',
  responseType: 'code',
  scope:
    'offline_access openid profile email phone AccountService IdentityService AdministrationService SaasService ProductService',
  requireHttps: true,
};

export const environment = {
  production: false,
  application: {
    baseUrl,
    name: 'mvm',
  },
  oAuthConfig,
  apis: {
    default: {
      url: 'https://localhost:44325',
      rootNamespace: 'mvm',
    },
    AbpAccountPublic: {
      url: oAuthConfig.issuer,
      rootNamespace: 'AbpAccountPublic',
    },
    ProductService: {
      url: 'https://localhost:44325',
      rootNamespace: 'mvm',
    },
 // ADDED SERVICES HERE
    SecondService: {
      url: 'https://localhost:44325',
      rootNamespace: 'mvm',
    },
    ThirdService: {
      url: 'https://localhost:44325',
      rootNamespace: 'mvm',
    },
// END OF CHANGES
  },
} as Environment;

The instructions for generating a microservice are not clear on this point.

Question 2

I am unclear what the steps are to generate proxies for multiple microservices.
I do not fully understand the steps in the support ticket I linked. Can you please walk me through the steps. I have the same problem as documented in the linked ticket. I need explicit instructions for what I need to do to generate proxies for my multiple microservices.

The command still does not work:

(base) PS C:\Users\Jpietkiewicz\repos\mvm\app\apps\angular [v1.0 ≡]
> abp generate-proxy -t ng -m cetolresultService -u https://localhost:45011
[14:37:39 INF] ABP CLI (https://abp.io)
[14:37:39 INF] Version 5.2.1 (Stable)
[14:37:40 WRN] Couldn't determinate version of "@abp/ng.schematics" package.
[Invalid Module] Backend module "productService" does not exist in API definition.

Why is it asking about productService?

This is an urgent matter as our work is blocked.

Do you know if this issue is fixed in 5.2.2? I noticed that version is available now.

Update

I updated to abp 5.2.2 and still have the same problem.

abp generate-proxy -t ng -m cetolresultService -u https://localhost:45011

It is still complaining about productService. This is a completely different service.

[Invalid Module] Backend module "productService" does not exist in API definition.

Epiphany

I figured it out: abp generate-proxy appears to be reading src/app/proxy/generate-proxy.json That file only knows about productService at the moment.

The generate proxy command is still not working when there are multiple microservices that need proxies. You cannot generate one proxy then another. If I delete the src/app/proxy/ folder I can generate proxies as expected for cetolresultService. Then, if I try to generate a proxy for product service, it complains about cetolresultService

[Invalid Module] Backend module "cetolresultService" does not exist in API definition.

**Please confirm with developers how to generate microservice proxies for multiple microservices? This is broken and needs to be fixed. ** Also, please investigate/advise how to work around this manually.

Potential workaround until this is properly fixed

Does the application use generate-proxy.json? If not, it looks like maybe I can delete that file, and for each service:

  • run the proxy generation
  • backup the new service's folder from the src/app/proxy/folder

Then, when all services have had their proxy generated,

  • Put all the individual service folders back into src/app/proxy/folder
  • manually edit index.ts to include all the imports. For example:
import * as CetolresultService from './cetolresult-service';
export { CetolresultService };
import * as ProductService from './product-service';
export { ProductService };

I'm fine with making this ticket public, but I can't seem to figure out how to do so.

Have you checked with developers to see if the angular web application is using generate-proxy.json? Is that only there for the abp cli?

Thanks!

Your suggestion does not work

I made sure all services are running with run-tye.ps1 then confirmed in the tye dashboard.

I generated the library code and made the modifications to .../apps/angular/tsconfig.json and .../apps/angular/src/environments/environment.ts

Then I run the proxy generation command:

abp generate-proxy -t ng -m cetolresultService -u https://localhost:45011 --target cetolresult-service

fails with

Unknown option: '--url'
Unknown option: 'https://localhost:45011'

I'm using v5.2.2. Do I need to use 5.3.0-rc.1 for your suggestion to work?

Need examples of ng library approach in ABP microservice application

Is there a microservice example that shows a completed implementation, i.e. the Product service, with the angular lib approach you propose? The microservice startup template (from 5.2.1) does not use this approach for the product service. I'm working/learning from the startup template and without an example I'm probably going to be lost on how to tie the pieces together.

Thanks!

It looks like I had not upgraded the packages to 5.2.2 after updating the abp cli version. After abp update and a repo purge I was able to generate the proxy with the steps you provided.

I have looked over the example you sent me and I think there are more steps I need to follow to clean out the old proxy info in tsconfig.json.

I still have lines like this in the paths array:

      "@proxy": ["src/app/proxy/index.ts"],
      "@proxy/*": [
        "src/app/proxy/*"
      ],

I'm removing those, the proxy folder, and repeating the steps for the product service that came with the template.

It also looks like the sample you provided exports a slightly different public-api Your suggestion:

export * from './lib/proxy';

The sample application

export * from './lib/proxy/product-service/index';
Showing 1 to 10 of 12 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11