Activities of "jpietkiewicz_"

The 2 biggest issues I have with the support are: One line answers with no explanation or details. For example: "Add an override to the X method" and then a link to code on GitHub Similar to item 1, single line responses that are a link to documentation that doesn't answer the question and in most cases we've already read.

Bare-minimum support is to provide a link to documentation. Don't do the bare minimum only.

World-class support attempts to understand what the user is asking and provide a slightly more in-depth answer, an example, or short code snippet. Strive to be world-class.

Thank you very much!

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';

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.

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?

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 };

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

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.

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.

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.

Showing 1 to 10 of 12 entries
Made with ❤️ on ABP v9.0.0-preview. Updated on October 07, 2024, 08:52